package com.itheima.flowcontrol.loop;

/**
 * for循环语句 求和
 */
public class ForPractise01 {
    public static void main(String[] args) {
        test01();
    }

    public static void test01() {
        int sum = 0;
        for (int i = 1; i < 6; i++) {
             sum += i;


        }
        System.out.println("1-5之间的数据和为:");
        System.out.println(sum);


    }
}






